package com.wudizaba.microservicesdemoauth.module.po;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author wudizaba
 * @since 2024-06-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("microservices_userinfo")
@Tag(name="MicroservicesUserinfo对象")
public class MicroservicesUserinfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(name = "id", description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(name = "username", description = "用户名")
    private String username;

    @Schema(name = "password", description = "密码")
    private String password;

    @Schema(name = "email", description = "邮箱")
    private String email;

    @Schema(name = "first_name", description = "姓")
    private String firstName;

    @Schema(name = "last_name", description = "名字")
    private String lastName;

    @Schema(name = "phone_number", description = "手机号码")
    private String phoneNumber;

    @Schema(name = "address", description = "家庭地址")
    private String address;

    @Schema(name = "city", description = "居住城市")
    private String city;

    @Schema(name = "state", description = "省份/州")
    private String state;

    @Schema(name = "country", description = "国家")
    private String country;

    @Schema(name = "zip_code", description = "邮政编码")
    private String zipCode;

    @Schema(name = "date_of_birth",description = "出生日期")
    private LocalDate dateOfBirth;


    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(name = "is_active", description = "是否激活，通常用于标记账户是否被禁用")
    private Boolean isActive;

    @Schema(name = "is_admin", description = "是否是管理员")
    private Boolean isAdmin;
}
